<?php
 
//Pull the info from the row with $id as their id
$query = "SELECT * FROM users WHERE id = $id";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
    extract($row);
}
 
// Let's see if they are online and assign a variable
if ($online == '0')
		$reallyonline = 'Offline';	
else
		$reallyonline = 'Online';	

//Set up the image and font style(s) and color(s)
Header ("Content-type: image/png"); 
$img_handle = imageCreateFromPNG("$pathtoimg");
$color = ImageColorAllocate ($img_handle, 0, 0, 0);
 
 
// Show your server's info
ImageString ($img_handle, 2, 40, 7,  "$serverdesc", $color);
//Show Players IGN and level
ImageString ($img_handle, 3, 80, 23,  "$name", $color);
ImageString ($img_handle, 3, 80, 35,  "Level:", $color);
ImageString ($img_handle, 2, 125, 35,  "$stat_elv", $color);
// Show HP
ImageString ($img_handle, 3, 80, 47,  "HP:", $color);
ImageString ($img_handle, 2, 103, 47,  "$stat_hp_min", $color);
ImageString ($img_handle, 2, 135, 47,  "/", $color);
ImageString ($img_handle, 2, 147, 47,  "$stat_hp_max", $color);
// Show MP
ImageString ($img_handle, 3, 80, 59,  "PP:", $color);
ImageString ($img_handle, 2, 103, 59,  "$stat_mp_min", $color);
ImageString ($img_handle, 2, 135, 59,  "/", $color);
ImageString ($img_handle, 2, 147, 59,  "$stat_mp_max", $color);
// Show Player Description
ImageString ($img_handle, 2, 40, 86,  "$descr", $color);
 
ImagePng ($img_handle); 
ImageDestroy ($img_handle);
?>